package com.summer.campussct.utils;

import org.mindrot.jbcrypt.BCrypt;

public class PasswordUtil {

    /**
     * 密码加密
     */
    public static String encrypt(String source){
        String salt = BCrypt.gensalt();
        return BCrypt.hashpw(source, salt);
    }

    /**
     * 密码校验
     */
    public static boolean check(String source, String pwdCode){
        return BCrypt.checkpw(source, pwdCode);
    }
}
